<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  子页面
  <div id="post"></div>
  <button id="btn">发送</button>
  <script>
document.getElementById('btn').onclick=function(){
    window.parent.postMessage({value:sonpage,label:"来自子页面"},'*');    
}
    
window.addEventListener('message', function(event) {   
    console.log('father');
  console.log(event.data)
  document.getElementById('post').innerHTML=event.data
});
  </script>
</body>
</html>